input only accept numbers

86

input only accept numbers -

<label for="salary">Enter your salary:</label>
<input type="text" id="salary" name="salary"
    oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');" />

Comments

Submit
0 Comments